<template>
	<view class="my-search-cotainer" :style="{'background-color':bgcolor }" @click="searchBoxHandler">
		<view class="my-search-box">
			<!-- 使用uniapp的图标组件 -->
			<uni-icons type="search" size="17"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-search",
		data() {
			return {
				//背景颜色
				bgcolor:{
					type:String,
					default:'#C00000'
				}
			};
		},
		methods:{
			searchBoxHandler(){
				console.log("________")
				this.$emit('click')
			}
			
		}
	}
</script>

<style lang="scss">
	.my-search-cotainer{
		height:50px;
		background-color:#F2B7D3 ;
		display: flex;
		align-content: center;
		padding: 10px 10px 0 10px ;
		.my-search-box{
			height: 36px;
			width: 100%;
			background-color: white;
			border-radius: 18px;
			display: flex;
			justify-content: center;
			align-items: center;
			.placeholder{
				font-size: 15px;
				margin-left: 5px;
			}
			
		}
	}
</style>